<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/27 0027
 * Time: 09:53
 */

namespace app\model\model;


class Label extends Base
{
    public function getList($where=false,$li){
        return $this->order('id desc')->where($where)->paginate($li);
    }
    public function getListSelect(){
        return $this->where(['flag'=>1])->order('id desc')->select();
    }
    /**
     * 添加
     * */
    public function add($data){
        return $this->data($data)->save();
    }
    /**
     * 获取
     * */
    public function getOne($id){
        return $this->where(['id'=>$id])->find();
    }
    /**
     * 修改
     * */
    public function up($where,$data){
        return $this->where($where)->update($data);
    }
    /**
     * 批量修改
     * */
    public function upAll($where,$data){
        return $this->where('id','in',$where)->update($data);
    }
    /**
     * 完全删除
     * */
    public function del($where){
        return $this->where($where)->delete();
    }
    public function delAll($where){
        return $this->where('id','in',$where)->delete();
    }
}